﻿using Grow.Module;
using Grow.Module.AspNetCore;
using Grow.Module.AspNetCore.Service;
using Grow.Module.Service;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace Grow.AspNetCore
{
    public class AspNetCoreModule : AspNetCoreModuleBase
    {
        public override ModuleLevel Level => ModuleLevel.Application;

        public override void AddDependModule(IDependModuleBuilder dependModuleBuilder)
        {
        }

        public override void AddService(IServiceContainer serviceContainer)
        {
            _ = serviceContainer.ServiceCollection.AddHttpContextAccessor();
        }

        public override void UseService(IApplicationServiceContext applicationServiceContext)
        {
            _ = applicationServiceContext.GetApplicationBuilder().UseHttpsRedirection();
        }
    }
}
